<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\svip\osp\service;

class SvipPriceInfo {
	
	static $_TSPEC;
	public $beginTime = null;
	public $endTime = null;
	public $vpid = null;
	public $originalPrice = null;
	public $price = null;
	public $beforeCutPrice = null;
	public $mobileOpenType = null;
	public $goodsType = null;
	public $bizType = null;
	public $priceDesc = null;
	public $discountedPrice = null;
	public $priceName = null;
	public $discounted = null;
	public $renewalPrice = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'beginTime'
			),
			2 => array(
			'var' => 'endTime'
			),
			3 => array(
			'var' => 'vpid'
			),
			4 => array(
			'var' => 'originalPrice'
			),
			5 => array(
			'var' => 'price'
			),
			6 => array(
			'var' => 'beforeCutPrice'
			),
			7 => array(
			'var' => 'mobileOpenType'
			),
			8 => array(
			'var' => 'goodsType'
			),
			9 => array(
			'var' => 'bizType'
			),
			10 => array(
			'var' => 'priceDesc'
			),
			11 => array(
			'var' => 'discountedPrice'
			),
			12 => array(
			'var' => 'priceName'
			),
			13 => array(
			'var' => 'discounted'
			),
			14 => array(
			'var' => 'renewalPrice'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['beginTime'])){
				
				$this->beginTime = $vals['beginTime'];
			}
			
			
			if (isset($vals['endTime'])){
				
				$this->endTime = $vals['endTime'];
			}
			
			
			if (isset($vals['vpid'])){
				
				$this->vpid = $vals['vpid'];
			}
			
			
			if (isset($vals['originalPrice'])){
				
				$this->originalPrice = $vals['originalPrice'];
			}
			
			
			if (isset($vals['price'])){
				
				$this->price = $vals['price'];
			}
			
			
			if (isset($vals['beforeCutPrice'])){
				
				$this->beforeCutPrice = $vals['beforeCutPrice'];
			}
			
			
			if (isset($vals['mobileOpenType'])){
				
				$this->mobileOpenType = $vals['mobileOpenType'];
			}
			
			
			if (isset($vals['goodsType'])){
				
				$this->goodsType = $vals['goodsType'];
			}
			
			
			if (isset($vals['bizType'])){
				
				$this->bizType = $vals['bizType'];
			}
			
			
			if (isset($vals['priceDesc'])){
				
				$this->priceDesc = $vals['priceDesc'];
			}
			
			
			if (isset($vals['discountedPrice'])){
				
				$this->discountedPrice = $vals['discountedPrice'];
			}
			
			
			if (isset($vals['priceName'])){
				
				$this->priceName = $vals['priceName'];
			}
			
			
			if (isset($vals['discounted'])){
				
				$this->discounted = $vals['discounted'];
			}
			
			
			if (isset($vals['renewalPrice'])){
				
				$this->renewalPrice = $vals['renewalPrice'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'SvipPriceInfo';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("beginTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->beginTime); 
				
			}
			
			
			
			
			if ("endTime" == $schemeField){
				
				$needSkip = false;
				$input->readI64($this->endTime); 
				
			}
			
			
			
			
			if ("vpid" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->vpid);
				
			}
			
			
			
			
			if ("originalPrice" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->originalPrice);
				
			}
			
			
			
			
			if ("price" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->price);
				
			}
			
			
			
			
			if ("beforeCutPrice" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->beforeCutPrice);
				
			}
			
			
			
			
			if ("mobileOpenType" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->mobileOpenType); 
				
			}
			
			
			
			
			if ("goodsType" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->goodsType); 
				
			}
			
			
			
			
			if ("bizType" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->bizType); 
				
			}
			
			
			
			
			if ("priceDesc" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->priceDesc);
				
			}
			
			
			
			
			if ("discountedPrice" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->discountedPrice);
				
			}
			
			
			
			
			if ("priceName" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->priceName);
				
			}
			
			
			
			
			if ("discounted" == $schemeField){
				
				$needSkip = false;
				$input->readBool($this->discounted);
				
			}
			
			
			
			
			if ("renewalPrice" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->renewalPrice);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->beginTime !== null) {
			
			$xfer += $output->writeFieldBegin('beginTime');
			$xfer += $output->writeI64($this->beginTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->endTime !== null) {
			
			$xfer += $output->writeFieldBegin('endTime');
			$xfer += $output->writeI64($this->endTime);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->vpid !== null) {
			
			$xfer += $output->writeFieldBegin('vpid');
			$xfer += $output->writeString($this->vpid);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->originalPrice !== null) {
			
			$xfer += $output->writeFieldBegin('originalPrice');
			$xfer += $output->writeString($this->originalPrice);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->price !== null) {
			
			$xfer += $output->writeFieldBegin('price');
			$xfer += $output->writeString($this->price);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->beforeCutPrice !== null) {
			
			$xfer += $output->writeFieldBegin('beforeCutPrice');
			$xfer += $output->writeString($this->beforeCutPrice);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->mobileOpenType !== null) {
			
			$xfer += $output->writeFieldBegin('mobileOpenType');
			$xfer += $output->writeI32($this->mobileOpenType);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->goodsType !== null) {
			
			$xfer += $output->writeFieldBegin('goodsType');
			$xfer += $output->writeI32($this->goodsType);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->bizType !== null) {
			
			$xfer += $output->writeFieldBegin('bizType');
			$xfer += $output->writeI32($this->bizType);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->priceDesc !== null) {
			
			$xfer += $output->writeFieldBegin('priceDesc');
			$xfer += $output->writeString($this->priceDesc);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->discountedPrice !== null) {
			
			$xfer += $output->writeFieldBegin('discountedPrice');
			$xfer += $output->writeString($this->discountedPrice);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->priceName !== null) {
			
			$xfer += $output->writeFieldBegin('priceName');
			$xfer += $output->writeString($this->priceName);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->discounted !== null) {
			
			$xfer += $output->writeFieldBegin('discounted');
			$xfer += $output->writeBool($this->discounted);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->renewalPrice !== null) {
			
			$xfer += $output->writeFieldBegin('renewalPrice');
			$xfer += $output->writeString($this->renewalPrice);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>